<?php

/**
 * @developer Socheat
 * @copyright 2012
 */
 $p=isset($_GET['id'])?$_GET['id']:"";					
if(!empty($p))
{
          
    //select from where to_user
    $mailpath   = "email_id='".$p."'";
    $email      = new mailUser();
    $email      = $email->getmail($mailpath);
    $emailgets   = mysql_fetch_assoc($email); 
    
    // for product
    $product_detail = new prodcut_tb();
    $GetProduct=$product_detail->product_detail($emailgets['pro_id']);
    $Getpro_rows=mysql_fetch_assoc($GetProduct); 
    
    //update status
    $read       = mysql_query("UPDATE contact SET STATUS=1 WHERE email_id=$p");
?>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css" />
<style>
    .toggler
    {
        margin: 10px 0 0 0;
    }
	.button {		
		text-decoration: none;        
	}
    .point
    {
        cursor: pointer;
    }
	#effect {
		position: relative;
		padding: 0.4em;
	}
	h3.statistic {
		margin: 0;
		padding: 0.4em;
		text-align: left;
        font-size: 14px;
        display:block;
	}
    .t_none
    {
        border:none;
    }
</style>
<form method="post" action="<?php echo W_ROOT;?>/product/contact.php?product=<?php echo $Getpro_rows['id'];?>&reply=<?php echo $emailgets['userid'];?>&idemail=<?php echo $p;?>" target="_blank">
<div style="margin: 10px 15px 0 0;">
<h3 class="statistic ui-widget-header ui-corner-all"><!--Inbox--><?php echo $lang['SELLERINBOX'];?></h3>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <th><strong><!--ID--><?php echo $lang['ID'];?></strong></th>
    <th><strong><!--Images--><?php echo $lang['IMG'];?></strong></th>
    <th><strong><!--Product name--><?php echo $lang['PRO_NAME'];?></strong></th>
    <th><strong><!--Quantity--><?php echo $lang['CON_QUANTITY'];?></strong></th>
    <th><strong><!--Price--><?php echo $lang['CON_PRICE'];?></strong></th>
  </tr>
          <tr>
    <td><?php echo $Getpro_rows['id'];?></td>
    <td><img height="50" width="50" style="float: left;" class="img-active" src="<?php echo W_S_IMAGES_DIR.$Getpro_rows['thumbnail'];?>" /></td>
    <td><a href="<?php echo W_ROOT;?>/product/product_detail.php?product_id=<?php echo $Getpro_rows['id']?>" title="<?php echo $Getpro_rows['product_name'];?>" target="_blank"><?php echo $Getpro_rows['product_name'];?></a></td>
    <td><?php echo $emailgets['quantity'];?></td>
    <td><?php echo $Getpro_rows['price'];?> <!--$--><?php echo $lang['DOLLARS'];?></td>
  </tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><strong><!--From--><?php echo $lang['SFROM'];?>:</strong></td>
    <td><?php echo $emailgets['userid'];?></td>
  </tr>
  <tr>
    <td><strong><!--Subject--><?php echo $lang['SUBJECTT'];?>:</strong></td>
    <td><?php echo $emailgets['title'];?></td>
  </tr>
  <tr>
    <td><strong><!--Message--><?php echo $lang['SELL_MSS'] ;?>:</strong></td>
    <td><?php echo $emailgets['message'];?></td>
  </tr>
</table>
<button type="submit" name="reply_to" class="btn btn-warning right"><i class="icon-share-alt icon-white"></i> <!--Reply--><?php echo $lang['SREPLY'];?></button> <a href="<?php echo W_ROOT;?>/company/action/?p=email/index" class="btn"><!--Back--><?php echo $lang['BACKK'];?></a>
</div>
</form> 
<?php
}
else
{
    echo 'no email';
}
?> 
 